home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 90 / 090.d81 / stack 'em.bas (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1991-01-01  |  8.3 KB  |  245 lines

  1. 1 dimgd(7,27),sc(6,27),hi(11),hi$(11),ht(11),pc(11),cl$(11),b9$(11)
  2. 2 poke53281,0:poke53280,0:print"[147]":gosub60000
  3. 3 dv=peek(186):ifdv<8thendv=8
  4. 10 poke650,128:print"[144]"
  5. 20 load"stack.font",8,128
  6. 30 load"stack.pause",8,128
  7. 40 print"[147]":poke56576,4:poke53272,2:poke648,192:poke53265,27
  8. 50 open1,dv,2:close1:ifst<>0then70
  9. 60 open15,dv,15,"r0:stack.hi=0:stack.hi"
  10. 65 input#15,er,er$,a,a:close15:ifer=63then80
  11. 70 forx=1to10:hi$(x)="[160]":hi(x)=0:next:goto100
  12. 80 open1,dv,2,"stack.hi,p,r":forx=1to10
  13. 90 input#1,hi$(x):input#1,hi(x):next:close1
  14. 100 hi=hi(1):forx=1to21:gd(0,x)=9:gd(7,x)=9:next
  15. 110 forx=0to7:readcl$(x):next
  16. 120 data"[144]","","[159]","[156]","","","[158]",""
  17. 130 forx=1to3:readch$(x):next
  18. 140 data"1.[160]play[160]stack[160]'em","2.[160]instructions","3.[160]quit"
  19. 150 print"[146][154][147]"tab(9)"[159][213][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][201]"
  20. 160 printtab(9)"[199][129][160]s[160]t[160]a[160]c[160]k[160][160][160]'[160]e[160]m[160][159][200] "
  21. 170 printtab(9)"[159][199][154][160][160][160]by[160]brian[160]boese[160][160][159][200] "
  22. 180 printtab(9)"[159][199][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][200] "
  23. 190 printtab(9)"[159][199][160]1.[160]play[160]stack[160]'em[160][159][200] "
  24. 200 printtab(9)"[159][199][154][160]2.[160]instructions[160][160][160][159][200] "
  25. 210 printtab(9)"[159][199][154][160]3.[160]quit[160][160][160][160][160][160][160][160][160][160][160][159][200] "
  26. 220 printtab(9)"[159][202][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][203] "
  27. 230 printtab(11)"                    ":ps=1
  28. 240 printtab(5)"[159][213][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][201]"
  29. 250 printtab(5)"[199][154][160][160][160][160][160][160][160][160]high[160]scores[160][160][160][160][160][160][160][160][159][200] "
  30. 260 printtab(5)"[159][199][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][200] "
  31. 270 forx=1to10:printtab(5)"[159][199][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][200] ":next
  32. 280 printtab(5)"[159][202][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][203] "
  33. 290 printtab(6)"                             "
  34. 300 print"[154]";:forx=1to10:printtab(6)hi$(x);
  35. 310 printtab(33-len(str$(hi(x))))mid$(str$(hi(x)),2):next
  36. 320 js=peek(56320)and31:geta$:ifjs=31anda$=""then320
  37. 330 ifjs=15thena$=chr$(13)
  38. 340 ifjs=30thena$="[145]"
  39. 350 ifjs=29thena$=""
  40. 360 ifa$>"0"anda$<"4"thenps=val(a$):a$=chr$(13)
  41. 370 ifa$=chr$(13)then420
  42. 380 print"[154]":forx=1tops+3:print"";:next:printtab(11)ch$(ps)
  43. 390 ifa$=""thenps=ps+1:ifps=4thenps=1
  44. 400 ifa$="[145]"thenps=ps-1:ifps=0thenps=3
  45. 410 print"":forx=1tops+3:print"";:next:printtab(11)ch$(ps):goto320
  46. 420 ifps=1thengosub450:goto150
  47. 430 ifps=2thengosub1790:goto150
  48. 440 poke56576,151:poke648,4:poke53272,21:print"[147]"
  49. 442 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  50. 444 ifer<>63thenend
  51. 446 f$="hello connect":print"[147]loadf$,8":poke631,19:poke632,131:poke198,2:end
  52. 450 print"[154][147]":printtab(5)"[151][167][146][160][160][160][160][160][160][165]"
  53. 460 forx=1to17:printtab(5)"[151][167][146][160][160][160][160][160][160][165][146] ":next:printtab(5)"[151][188][163][163][163][163][163][163][190][146] "
  54. 470 printtab(6)"        ":lv=0:sc=0
  55. 480 print""tab(18)"[159][213][196][196][196][196][196][196][196][196][196][196][196][196][196][196][201]"
  56. 490 printtab(18)"[199][154][160][160][160][160][160][160][160][160][160][160][160][160][160][160][159][200] ":printtab(18)"[159][199][154][160][160]stack[160]'em[160][160][160][159][200] "
  57. 500 printtab(18)"[159][199][154]by[160]brian[160]boese[159][200] ":printtab(18)"[159][199][154][160][160][160][160][160][160][160][160][160][160][160][160][160][160][159][200] "
  58. 510 printtab(18)"[159][199][154][160]high:[160][160][160][160][160][160][160][160][159][200] ":printtab(18)"[159][199][154][160]score:[160][160][160][160][160]0[160][159][200] "
  59. 520 printtab(18)"[159][199][154][160][160][160][160][160][160][160][160][160][160][160][160][160][160][159][200] ":printtab(18)"[159][202][198][198][198][198][198][198][198][198][198][198][198][198][198][198][203] "
  60. 530 printtab(19)"                "
  61. 540 print"[145][145][145][145][145][154]"tab(33-len(str$(hi)))mid$(str$(hi),2)
  62. 550 forx=1to3:pc(x)=int(rnd(0)*6+1):next:ps=1:hz=int(rnd(0)*6+1):vt=21:px=0
  63. 560 gosub1330:x=ps
  64. 570 fory=0to2:printcl$(pc(x))"[160][157]";:x=x+1:ifx>3thenx=1
  65. 580 next:ifvt>19thenprint"[145][145][146]";:forx=20tovt:print" [157]";:next
  66. 590 ifpx=1then610
  67. 600 px=1:ti$="000000"
  68. 610 ifti<(100-25*lv)then710
  69. 620 vt=vt-1:ifvt>ht(hz)+2then680
  70. 630 vt=vt+1:ht(hz)=ht(hz)+3
  71. 640 x=ps:fory=0to2:gd(hz,vt-y)=pc(x):x=x+1:ifx=4thenx=1
  72. 650 next
  73. 660 gosub1380:ifht(hz)<19then550
  74. 670 goto1000
  75. 680 gosub1330:ifvt<18thenprint"[145][144][160]";:goto700
  76. 690 print"[145][154][146] ";:ifvt>18thenprint" ";
  77. 700 px=0:goto560
  78. 710 geta$:js=peek(56320)and31
  79. 720 ifjs=30thena$="k"
  80. 730 ifjs=27thena$="j"
  81. 740 ifjs=23thena$="l"
  82. 750 ifjs=29thena$=" "
  83. 760 ifjs=15thena$="p"
  84. 770 ifa$<>"q"anda$<>"j"anda$<>"k"anda$<>"l"anda$<>"p"anda$<>" "then610
  85. 780 ifa$<>"p"then860
  86. 790 ifvt>18thengosub1330:forx=19tovt:print"[146][154]  [157][157]";:next
  87. 800 poke53272,18:poke648,196
  88. 810 js=peek(56320)and31:ifjs=15then810
  89. 820 geta$:js=peek(56320)and31:ifjs<>15anda$<>"p"then820
  90. 830 poke53272,2:poke648,192
  91. 840 js=peek(56320)and31:ifjs=15then840
  92. 850 goto560
  93. 860 ifa$<>"q"then880
  94. 870 print"[154][147]":forhz=1to6:ht(hz)=0:forvt=1to21:gd(hz,vt)=0:next:next:return
  95. 880 ifa$="k"thenps=ps+1:ifps=4thenps=1:goto560
  96. 890 ifa$<>"l"orgd(hz+1,vt)>0orgd(hz+1,vt-1)>0orgd(hz+1,vt-2)>0then910
  97. 900 gosub1340:hz=hz+1
  98. 910 ifa$<>"j"orgd(hz-1,vt)>0orgd(hz-1,vt-1)>0orgd(hz-1,vt-2)>0then930
  99. 920 gosub1340:hz=hz-1
  100. 930 ifa$<>" "then560
  101. 940 gosub1340
  102. 950 vt=ht(hz)+3:gosub1330:x=ps
  103. 960 fory=0to2:printcl$(pc(x))"[160][157]";:gd(hz,vt-y)=pc(x):x=x+1:ifx>3thenx=1
  104. 970 next:ht(hz)=vt
  105. 980 gosub1380
  106. 990 ifht(hz)<19then550
  107. 1000 print"[146][213][196][196][196][196][196][196][196][196][196][196][196][196][201]":print"[199][160][160][160][160][160][160][160][160][160][160][160][160][200]"
  108. 1010 print"[199][160]game[160][160]over[160][200]":print"[199][160][160][160][160][160][160][160][160][160][160][160][160][200]"
  109. 1020 print"[202][198][198][198][198][198][198][198][198][198][198][198][198][203]"
  110. 1030 js=peek(56320)and31:geta$:ifa$=""andjs=31then1030
  111. 1040 print"[154][147]":forhz=1to6:ht(hz)=0:forvt=1to21:gd(hz,vt)=0:next:next
  112. 1050 ifsc<hi(10)then1320
  113. 1060 print"[154][147]"tab(8)"[213][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][201]"
  114. 1070 printtab(8)"[199][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][200]"
  115. 1080 printtab(8)"[199][159][160][160]you[160]made[160]the[160]high[160][160][160][154][200]"
  116. 1090 printtab(8)"[199][159][160][160]score[160]list![160]enter[160][160][160][154][200]"
  117. 1100 printtab(8)"[199][159][160][160]your[160]name:[160][160][160][160][160][160][160][160][160][160][154][200]"
  118. 1110 printtab(8)"[199][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][200]"
  119. 1120 printtab(8)"[199][159][160][160][146][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][154][200]"
  120. 1130 printtab(8)"[199][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][200]"
  121. 1140 printtab(8)"[202][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][203]"
  122. 1150 print"[159][145][145][145]"tab(10);:l=0:hi$="[160]":poke198,0
  123. 1160 geta$:ifa$=""then1160
  124. 1170 ifa$=chr$(13)then1250
  125. 1180 ifa$<>chr$(20)then1210
  126. 1190 ifl=0then1160
  127. 1200 l=l-1:hi$=left$(hi$,l+1):print"[146][160][157][157][160][146][157]";:goto1160
  128. 1210 if(a$<"a"ora$>"z")and(a$<"0"ora$>"9")anda$<>" "then1160
  129. 1220 ifa$=" "thena$="[160]"
  130. 1230 ifl<20thenhi$=hi$+a$:l=l+1:printa$"[160][146][157]";
  131. 1240 goto1160
  132. 1250 hi$(10)=hi$:hi(10)=sc:ps=9
  133. 1260 if(ps=0)or(hi(ps)>sc)then1280
  134. 1270 hi(ps+1)=hi(ps):hi$(ps+1)=hi$(ps):hi(ps)=sc:hi$(ps)=hi$:ps=ps-1:goto1260
  135. 1280 open1,dv,2:close1:ifst<>0then1320
  136. 1290 open15,dv,15,"s0:stack.hi":close15
  137. 1300 open1,dv,2,"stack.hi,p,w"
  138. 1310 forx=1to10:print#1,hi$(x):print#1,hi(x):next:close1
  139. 1320 return
  140. 1330 print"";:forx=1to22-vt:print"";:next:forx=1tohz+5:print"";:next:return
  141. 1340 gosub1330:ifvt<19thenprint"[144][160][157][160][157][160]":goto1370
  142. 1350 print"[146][154] [157]";:ifvt>19thenforx=20tovt:print"  [157][157]";:next
  143. 1360 ifvt<21thenforx=1to21-vt:print"[144][160][157]";:next
  144. 1370 return
  145. 1380 h=hz
  146. 1390 forhz=1to6:ps=ht(hz)
  147. 1400 ifps<3then1470
  148. 1410 cl=gd(hz,ps):vt=ps
  149. 1420 ps=ps-1:ifcl=gd(hz,ps)then1420
  150. 1430 ifvt-ps<3then1400
  151. 1440 forx=ps+1tovt:sc(hz,0)=sc(hz,0)+1:sc(hz,x)=1:next:ln=ln+vt-ps-2
  152. 1450 gosub1330:forx=pstovt-1:print"[160][157]";:next
  153. 1460 goto1400
  154. 1470 next
  155. 1480 forhz=1to4:forvt=1toht(hz):fory=-1to1:cl=gd(hz,vt):ps=vt+y:pt=hz+1
  156. 1490 ifcl=0then1580
  157. 1500 ifgd(pt,ps)=clthenps=ps+y:pt=pt+1:goto1500
  158. 1510 ifpt-hz<3then1580
  159. 1520 ln=ln+1:gosub1330:forx=1topt-hz:print"[160]";
  160. 1530 ify=-1thenprint"";
  161. 1540 ify=1thenprint"[145]";
  162. 1550 ifsc(hz+x-1,vt+(x-1)*y)=1then1570
  163. 1560 sc(hz+x-1,vt+(x-1)*y)=1:sc(hz+x-1,0)=sc(hz+x-1,0)+1
  164. 1570 next
  165. 1580 next:next:next
  166. 1590 ifln=0then1750
  167. 1600 sc=sc+ln:ln=0:lv=int(sc/100):iflv>3thenlv=3
  168. 1610 ifsc>hithenhi=sc
  169. 1620 print"[146][154]"tab(33-len(str$(hi)))mid$(str$(hi),2)
  170. 1630 printtab(33-len(str$(sc)))mid$(str$(sc),2)
  171. 1640 forx=15to1step-1:poke54296,x:fory=1tox*10:next:poke54296,0:next
  172. 1650 forhz=1to6:ifsc(hz,0)=0then1740
  173. 1660 vt=1:pt=1
  174. 1670 ifsc(hz,vt)=0thenvt=vt+1:pt=pt+1:goto1670
  175. 1680 ifsc(hz,pt)=1thensc(hz,pt)=0:pt=pt+1:goto1680
  176. 1690 gd(hz,vt)=gd(hz,pt):gosub1330:ifvt<19thenprintcl$(gd(hz,vt))"[160]":goto1730
  177. 1700 ifgd(hz,vt)=0thenprint"[154][146]  ":goto1730
  178. 1710 printcl$(gd(hz,vt))"[160][146]";:ifgd(hz,vt+1)>0thenprint" ":goto1730
  179. 1720 print"[154] "
  180. 1730 pt=pt+1:vt=vt+1:ifgd(hz,vt)>0then1680
  181. 1740 ht(hz)=ht(hz)-sc(hz,0):sc(hz,0)=0:next:goto1390
  182. 1750 hz=h:return
  183. 1760 printtab(7)"[158]press[160]any[160]key[160]to[160]continue.";
  184. 1770 js=peek(56320)and31:geta$:ifa$=""andjs=31then1770
  185. 1780 return
  186. 1790 print"[144][147][154]"tab(9)"s[160]t[160]a[160]c[160]k[160][160][160]'[160]e[160]m":printtab(9)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  187. 1800 print"[154][160][160]stack[160]'em[160]is[160]a[160]one-player[160]game[160]where"
  188. 1810 print"[160]you[160]try[160]to[160]put[160]colored[160]tiles[160]into"
  189. 1820 print"[160]sequences[160]of[160]the[160]same[160]color,"
  190. 1830 print"[160]horizontally,[160]vertically[160]or"
  191. 1840 print"[160]diagonally."
  192. 1850 print"[160][160]play[160]is[160]on[160]a[160]6*18[160]grid[160]of[160]squares,"
  193. 1860 print"[160]and[160]tiles[160]drop[160]from[160]the[160]top[160]of[160]the"
  194. 1870 print"[160]screen.[160]each[160]tile[160]has[160]three[160]squares"
  195. 1880 print"[160]with[160]each[160]square[160]having[160]one[160]of[160]six"
  196. 1890 print"[160]colors[160]assigned[160]to[160]it[160]at[160]random.":gosub1760
  197. 1900 print"[144][147][154]"tab(14)"how[160]to[160]play":printtab(14)"[163][163][163][163][163][163][163][163][163][163][163]"
  198. 1910 print"[154][160][160]as[160]a[160]tile[160]drops[160]from[160]the[160]top[160]of[160]the"
  199. 1920 print"[160]screen,[160]you[160]may[160]do[160]the[160]following:"
  200. 1930 print"[160][160][160]move[160]it[160]left[160]and[160]right."
  201. 1940 print"[160][160][160]cycle[160]the[160]colors[160]in[160]the[160]tile."
  202. 1950 print"[160][160][160]drop[160]the[160]tile[160]into[160]position."
  203. 1960 print"[159][160][160][160][160][160][160][160][160][160][160][160][160]left[160]cycle[160]right[160]drop"
  204. 1970 print"[154][160]keyboard:[160][160][160][160]j[160][160][160][160]k[160][160][160][160][160]l[160][160][160]space"
  205. 1980 print"[160]joystick:[160][160]left[160][160][160]up[160][160]right[160]down"
  206. 1990 print"[160][160]in[160]addition,[160]to[160]pause[160]the[160]game[160]press"
  207. 2000 print"[160]either[160]the[160]'p'[160]key[160]or[160]the[160]joystick"
  208. 2010 print"[160]firebutton.[160]the[160]screen[160]will[160]be[160]blanked"
  209. 2020 print"[160]to[160]prevent[160]cheating.[160]pressing[160]the[160]'q'"
  210. 2030 print"[160]key[160]quits.":gosub1760
  211. 2040 print"[144][147][154]"tab(16)"scoring":printtab(16)"[163][163][163][163][163][163][163]"
  212. 2050 print"[154][160][160]for[160]every[160]separable[160]sequence[160]of[160]three"
  213. 2060 print"[160]squares[160]of[160]the[160]same[160]color[160]you[160]are"
  214. 2070 print"[160]given[160]one[160]point.[160]for[160]example,[160]a"
  215. 2080 print"[160]sequence[160]of[160]four[160]squares[160]will[160]give[160]you"
  216. 2090 print"[160]two[160]points,[160]and[160]a[160]sequence[160]of[160]five"
  217. 2100 print"[160]squares[160]will[160]give[160]you[160]three[160]points."
  218. 2110 print"[160][160]every[160]time[160]a[160]sequence[160]is[160]formed,[160]the"
  219. 2120 print"[160]squares[160]are[160]removed[160]from[160]the[160]board[160]and"
  220. 2130 print"[160]all[160]the[160]squares[160]above[160]these[160]are[160]moved"
  221. 2140 print"[160]down.[160]more[160]sequences[160]may[160]be[160]formed[160]in"
  222. 2150 print"[160]a[160]'chain[160]reaction'[160]as[160]a[160]result[160]of"
  223. 2160 print"[160]these[160]squares[160]moving[160]down."
  224. 2170 print"[160]example:[160][160][160][160]":printtab(12)"[160][160][158][160][160][160][158][160]"
  225. 2180 printtab(12)"[160][160][160][159]_[160][160][160][159]_[160][160][158][160]"
  226. 2190 printtab(12)"[160][159]^[160][160][160][160][160][160][160]":gosub1760
  227. 2200 print"[144][147][154][160][160]the[160]game[160]ends[160]when[160]a[160]tile[160]is[160]placed"
  228. 2210 print"[160]and,[160]after[160]all[160]sequences[160]are[160]removed,"
  229. 2220 print"[160]at[160]least[160]one[160]of[160]the[160]squares[160]in[160]a[160]tile"
  230. 2230 print"[160]goes[160]beyond[160]the[160]top[160]of[160]the[160]6*18[160]grid."
  231. 2270 gosub1760
  232. 2280 return
  233. 10000 open15,8,15,"s0:stack 'em.bas":close15:save"stack 'em.bas",8:end
  234. 60000 b9$="                                      "
  235. 60010 poke214,14:print:print"  [155][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][152]"
  236. 60020 fori=0to7:printb9$:next:print"  [151][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][152]"
  237. 60030 b9$(0)="[211] [212] [193] [195] [203]   ' [197] [205]"
  238. 60040 b9$(1)="by [194]rian [194]oese
  239. 60050 b9$(2)[178]"(NULL)1.0 (c) 1991 by (NULL)oftdisk, right$nc."
  240. 60060 b9$(3)[178]"(NULL)ublished on (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL) #90"
  241. 60070 b9$(4)[178]"(NULL)ubscriptions 1-800-831-2694"
  242. 60080 b9$(5)[178]"atnll (NULL)ights (NULL)eserved"
  243. 60090 [151]214,16:[153]:[129]i[178]0[164]5:[153][163]20[171]([195](b9$(i))[173]2))""b9$(i):[130]
  244. 60099 [142]
  245.